package dir1;

import luchbox.SHOP;

public class Menus {
	private String outcome="";
	
	public String getOutcome() {
		return outcome;
	}

	public void setOutcome(String outcome) {
		this.outcome = outcome;
	}

	public void setMenus(){
		SHOP s = new SHOP();	
		String data[][] =s.select();
		String id[]=new String[data.length];
		String number[]=new String[data.length];
		String name[]=new String[data.length];
		String phone[]=new String[data.length];
		String address[]=new String[data.length];
		
		for(int i = 0 ; i < data.length ;i++){
			id[i]=data[i][0];
			number[i]=data[i][1];
			name[i]=data[i][2];
			phone[i]=data[i][3];
			address[i]=data[i][4];			
		}
		
		for(int i = 0 ; i < data.length ;i++){ 
			//<option value="<%=id[i]%>"> <%=name[i]%> </option>
			outcome+= "<option value=\""+ id[i] +"\">"+ name[i] +"</option>";			    	
        }		
	}

	public void searchAll(){
		SHOP sh = new SHOP();	
		String data[][] = sh.select();	
		
		for(int i=0 ; i<data.length ; i++){
			outcome+= "<tr>";
			for(int j=0 ; j<data[i].length ; j++){
				outcome+= "<td>"+ data[i][j] +"</td>";
			}
			outcome+= "</tr>";
		}		
	}

}
